<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<!-- head -->
<head th:replace="~{fragment/head :: head}"></head>
<!-- head -->

<body class="hold-transition skin-blue sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">

    <!-- header -->
    <header th:replace="~{fragment/header :: header}"></header>
    <!-- header -->

    <!-- Left side column. contains the sidebar -->
    <!-- aside -->
    <aside th:replace="~{fragment/aside :: menu}"></aside>
    <!-- aside -->

    <!-- =============================================== -->

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">

        <!-- Main content -->
        <section class="content">
            <div class="container">
                <div class="col-md-10">
                    <div class="box box-default">
                        <div class="box-header with-border">
                            <h3 class="box-title">添加</h3>
                        </div>
                        <!-- /.box-header -->
                        <div class="box-body">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label for="inputEmail3" class="col-sm-2 control-label">Email</label>
                                    <div class="col-sm-6">
                                        <input type="email" class="form-control" id="inputEmail3" placeholder="Email">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
                                    <div class="col-sm-6">
                                        <input type="password" class="form-control" id="inputPassword3" placeholder="Password">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-6">
                                        <button type="submit" class="btn btn-info btn-block">确定</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <!-- footer begin -->
    <footer th:replace="~{fragment/footer::footer}"></footer>
    <!-- footer end -->
    <div></div>
</div>
<!-- ./wrapper -->
<script th:inline="javascript">

    // 创建一个Socket实例
    var socket = new WebSocket('ws://127.0.0.1:8090/websocket');

    // 打开Socket
    socket.onopen = function(event) {
        console.log("建立连接")
    };

    // 监听消息
    socket.onmessage = function(event) {
        console.log('Client received a message', event);
    };

    // 监听Socket的关闭
    socket.onclose = function(event) {
        console.log('Client notified socket has closed', event);
    };
    // 回车发送消息
    function onSend(e) {

    }

</script>
</body>
</html>
